<!--商品列表-->
<template>
  <el-table :data="ListShow">
  <el-table-column label="编号" prop="id" />
  <el-table-column label="商品图片" prop="photo" />
  <el-table-column label="商品标题" prop="title" />
  <el-table-column label="价格" prop="price" />
  <el-table-column label="销量" prop="saleCount" />
  </el-table>


</template>
<script setup>

import {onMounted, ref} from "vue";
import axios from "axios";
//定义数组保存数据
const ListShow=ref([]);

const productlist=()=>{
  axios.get(BASE_URL+'/v1/product/select').then((response)=>{
    if (response.data.code==2000){
      ListShow.value=response.data.data;
    }else {
      ElMessage.error(response.data.msg);
    }
  })

}

onMounted(()=>{
  productlist();
})
</script>

<style scoped>

</style>